﻿//逻辑代码
import {Puerts, UnityEngine} from 'csharp'
import {PuertsAction} from "nctask/PuertsAction";
import {$typeof} from 'puerts'
import {Component} from 'framework/component/component';
import Time = UnityEngine.Time;

class DebugAction  extends PuertsAction
{
    secondsToRun:number = 2
    constructor(jsBehavior:Puerts.PuertsActionTask) {
        super(jsBehavior);
    }
    OnInit(){
        console.log("js init")
    }
    OnUpdate(elapsedTime:number){
        if(elapsedTime > this.secondsToRun)
        {
            console.log("js OnUpdate")
            this.EndAction(true)
        }
    }
    OnExecute(){
        console.log("js OnExecute")
    }
    OnStop(){
        console.log("js OnStop")
    }
}

export function init (jsBehavior:Puerts.PuertsActionTask) {
    new DebugAction(jsBehavior);
}
